﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LPY.LeHealth.DAL;
using LPY.LeHealth.Model;

namespace LPY.LeHealth.Service
{
    using AutoMapper;
    using AutoMapper.Execution;
    using AutoMapper.Configuration;
    using AutoMapper.Mappers;
    using LPY.LeHealth.DTO;
    public class PersonalizedService
    {
        private PersonalizedDAL dal;

        public PersonalizedService()
        {
            dal = new PersonalizedDAL();
        }

        /// <summary>
        /// 根据医院id 显示医院单项体检产品
        /// </summary>
        /// <returns></returns>
        public List<Personalized__Examination> ShowPersonalized(int id)
        {
            var personalized = dal.GetList(id);
            var rtv = Mapper.Map<List<Personalized_ExaminationDTO>, List<Personalized__Examination>>(personalized);
            return rtv;
        }
        ///// <summary>
        ///// 查询单项总数量
        ///// </summary>
        ///// <param name="id"></param>
        ///// <returns></returns>
        //public int PersonalizedCoun()
        //{
        //    var personalized = dal.PersonalizedCoun();
        //    return personalized;
        //}


        /// <summary>
        ///单项体检显示
        /// </summary>
        /// <returns></returns>
        public List<Personalized__Examination> GetPersonalized_ExaminationDTO()
        {
            var personalized = dal.GetPersonalized_ExaminationDTO();
            var rtv = Mapper.Map<List<Personalized_ExaminationDTO>, List<Personalized__Examination>>(personalized);
            return rtv;
        }

    }
   
}
